To read data from the blockchain, use the Unity-Native implementation of the Sequence Indexer.
ChainIndexer
class. This will expose you to all the functionality offered by the IIndexer
interface.
Ping
async Task. This can be useful if a request is failing. During development, you can also check the status of our indexers on our status page.
GetEtherBalance
async Task.
GetTokenBalances
async Task.
GetTokenBalancesArgs
.
Page
you receive in your GetTokenBalancesReturn
to see if it has more and then if it does make another request, including the Page.
GetTokenBalancesOrganizedInDictionary
. This will fetch all of the TokenBalances for a given contractAddress and userAccountAddress and organize them into a Dictionary mapping tokenID (BigInteger) to TokenBalance. In general, you’ll want to use this most often.
GetTokenSupplies
async Task.
GetTokenSupplies
power users, we also provide a GetTokenSuppliesMap
async Task that allows you to fetch the supplies for multiple token contracts and token ids in a map.
suppliesMap[usdcAddress].Length = 1
with the TokenSupply object relating to the supply of the ERC20 token.
Similarly, you can expect that suppliesMap[skyweaverAddress].Length = 3
with the TokenSupply object relating to the specified token ids.
GetTransactionHistory
method.
TransactionHistoryFilter
object allows you to specify how you want to filter your transaction history query, e.g. by account address(es), contract address(es), etc. More info here.